#ifndef __VSFAV_USB_H_INCLUDED__
#define __VSFAV_USB_H_INCLUDED__

PACKED_HEAD struct PACKED_MID uavc_unit_descriptor_header
{
	struct usb_cs_header_t header;
	uint8_t id;
}; PACKED_TAIL

struct vsfav_usb_unit_parser_t
{
	struct
	{
		vsf_err_t (*parse_desc)(struct vsfav_usb_unit_parser_t*,
			struct vsfav_unit_t*, struct uavc_unit_descriptor_header*);
	} op;
	struct
	{
		uint8_t input_number;
		uint8_t *input_IDs;
	} unit;

	union
	{
		struct usb_interface_desc_t *ifs_desc;
		uint8_t *desc;
	};
	uint32_t desc_len;

	uint8_t *buf;
	uint32_t size;
	uint32_t unit_number;
	uint32_t idmask[8];

	struct vsfav_dev_t *av_dev;
};

void *vsfav_usb_getbuf(struct vsfav_usb_unit_parser_t *parser, uint32_t size);
vsf_err_t vsfav_usb_generate_topology(struct vsfav_usb_unit_parser_t *parser);
void vsfav_usb_parser_init(struct vsfav_usb_unit_parser_t *parser);

#endif		// __VSFAV_USB_H_INCLUDED__